package scatours;


import java.io.IOException;

import org.apache.tuscany.sca.node.Node;
import org.apache.tuscany.sca.node.NodeFactory;

import scatours.launcher.LauncherUtil;

public class FullAppLauncher {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Node node= NodeFactory.newInstance().createNode(
														LauncherUtil.locate("common"),
														LauncherUtil.locate("currency"),
														LauncherUtil.locate("flight"),
														LauncherUtil.locate("hotel"),
														LauncherUtil.locate("car"),
														LauncherUtil.locate("trip"),
														LauncherUtil.locate("tripbooking"),
														LauncherUtil.locate("travelcatalog"),						
														LauncherUtil.locate("payment-java"),
//														LauncherUtil.locate("creditcard-payment-jaxb-policy"),
														LauncherUtil.locate("shoppingcart"),
														LauncherUtil.locate("scatours"),
														//LauncherUtil.locate("fullapp-ui"),
														LauncherUtil.locate("fullapp-client"),
														LauncherUtil.locate("fullapp-coordination"),
														LauncherUtil.locate("fullapp-currency"),
														LauncherUtil.locate("fullapp-packagedtrip"),
														LauncherUtil.locate("fullapp-bespoketrip"),
														LauncherUtil.locate("fullapp-shoppingcart")
														);
		
		node.start();

//        System.out.println("Point your browser at - http://localhost:8080/scatours/ ");
        
        Runnable proxy=node.getService(Runnable.class, "SCAToursTestClient/Runnable");
		proxy.run();

		System.out.println("Node started - Press enter to shutdown.");
        try {
            System.in.read();
        } catch (IOException e) {
        }

        node.stop();
				

	}

}
